<!--
  @author: 善良的YWJ
  @Created by shanliangdeYWJ on 2020/09/21 12:23:00
  @file: people-card.vue
  @description:
  ==================
  人物介绍卡片
  ==================
  @link [Github](https://github.com/shanliangdeYWJ)
-->

<template>
  <div class="people-card">
    <i class="iconfont icon-ren"></i>
    <img v-if="people.img_url" :src="people.img_url" alt="">
    <h1 class="name">{{people.name}}{{people.sex?'先生':'女士'}}</h1>
    <span>{{people.position}}</span>
    <div class="msg">
      <p>{{people.msg}}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PeopleCard',
  props: {
    people: { type: Object }
  },
  data () {
    return {};
  }
};
</script>

<style lang='scss' scoped>
.people-card {
  background: #ffffff;
  display: inline-block;
  width: 30%;
  margin: 40px 1.5%;
  padding: 80px 0;
  border-radius: 10px;
  position: relative;
  text-align: center;
  .iconfont {
    transition: 0.2s;
    position: absolute;
    left: 50%;
    top: 0%;
    transform: translate(-50%, -50%);
    border: 3px solid #b9b9b9;
    background: #ffffff;
    font-size: 30px;
    font-weight: bold;
    color: #000000;
    display: inline-block;
    padding: 10px 20px;
    text-align: center;
    border-top-left-radius: 40%;
    border-bottom-right-radius: 40%;
  }

  .name {
    color: #000000;
    font-size: 16px;
  }

  .msg {
    position: absolute;
    left: 0%;
    bottom: 0%;
    background-color: rgba(122, 122, 122, 0.8);
    height: 2px;
    color: #ffffff;
    overflow: hidden;
    text-indent: 2em;
    transition: 0.2s;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    text-align: left;
  }
  &:hover > .iconfont {
    border-radius: 50%;
    border-color: var(--themeAColor);
  }
  &:hover > .msg {
    height: 80px;
    padding: 10px;
  }
}
</style>
